package com.example.rjb_shoping.controller;

import com.example.rjb_shoping.entity.RjbClassiflcation;
import com.example.rjb_shoping.service.RjbClassiflcationService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (RjbClassiflcation)表控制层
 *
 * @author makejava
 * @since 2021-06-09 20:42:36
 */
@RestController
@RequestMapping("rjbClassiflcation")
public class RjbClassiflcationController {
    /**
     * 服务对象
     */
    @Resource
    private RjbClassiflcationService rjbClassiflcationService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public RjbClassiflcation selectOne(Integer id) {
        return this.rjbClassiflcationService.queryById(id);
    }

    /**
     * 查询指定行的数据
     * @return
     */
    @GetMapping("selectAll")
    public List<RjbClassiflcation> selectAll(){
        return this.rjbClassiflcationService.queryAllByLimit(0,4);
    }

}
